package com.mall.cart.feign;

import com.mall.common.dto.SkuInfoDTO;
import com.mall.common.utils.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author: 谢君臣
 * @Date: 2022/8/8-16:12
 * @version: 1.0
 * @function:
 */
@FeignClient("productServer")
public interface ProductFeignClient {

    @GetMapping("/product/skuinfo/{id}")
    @ApiOperation("信息")
    Result<SkuInfoDTO> get(@PathVariable("id") Long id);

    @GetMapping("/product/skuinfo/strValue/{id}")
    Result<List<String>> getAttrNameAndValue(@PathVariable("id") Long id);

    @PostMapping("/product/skuinfo/price")
    Result<Map<String, BigDecimal>> getPricesBySkuIds(@RequestBody List<Long> skuIds);
}
